﻿using Common;
using Common.Dtos;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Sigma.Admin.Client.Services
{
    public class PermissionService : IPermissionService
    {
        private readonly HttpRestClient _client;
        private readonly string serviceName = "Permission";

        public PermissionService(HttpRestClient client)
        {
            _client = client;
        }
        public async Task<ApiResponse<List<PermissionDto>>> GetAllPermission()
        {
            BaseRequest request = new BaseRequest();
            request.Method = RestSharp.Method.GET;
            request.Route = $"api/{serviceName}/GetPermission";
            var res = await _client.ExecuteAsync<List<PermissionDto>>(request);

            return res;
        }


    }
}
